<?php

namespace Api\Controller;

use Common\Controller\AppframeController;
use Com\Wechat;
use Com\WechatAuth;

class CronController extends AppframeController
{
    function _initialize()
    {
        parent::_initialize();



    }



    public function wx_token_ref(){


        $wxconfig=F("Config_weixin");



        $wxauth = new WechatAuth($wxconfig["WX_APPID"], $wxconfig["WX_APPSECRET"]);




        $token = $wxauth->getAccessToken();

        $ticket= $wxauth->getJsApiTicket();





        $s=array(
            "token"=>$token["access_token"],
            "inputtime"=>time(),
            "ticket"=>$ticket["ticket"]
        );
        M("WxToken")->add($s);
//
//
//        dump($s);
//
//        echo "成功";








    }








}